package com.changgou.goods.dao;
import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:admin
 * @Description:Spec的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface SpecMapper extends Mapper<Spec> {

    /**
     * 根据商品的分类的id查询关联的规格数据
     * @param id
     * @return
     */
    @Select(value = "select ts.* from tb_category tc,tb_spec ts where tc.id=#{id} and ts.template_id = tc.template_id")
    List<Spec> findBySpecAndCategory(Integer id);
}
